home *** CD-ROM | disk | FTP | other *** search
- TextLoader = function()
- {
- this.init();
- };
- TextLoader.prototype = new MovieClip();
- TextLoader.prototype.convertToHTML = function(textData)
- {
- textArr = textData.split("\n");
- textData = textArr.join("");
- return textData;
- };
- TextLoader.prototype.loadData = function()
- {
- this.dataXML = new XML();
- this.dataXML.ignoreWhite = true;
- this.dataXML.thisPath = this;
- this.dataXML.onLoad = function(success)
- {
- if(success)
- {
- this.thisPath._parent[this.thisPath.targetTextField].html = true;
- this.thisPath._parent[this.thisPath.targetTextField].htmlText = this.thisPath.convertToHTML(this.firstChild.firstChild.nodeValue);
- this.thisPath._parent.play();
- }
- else
- {
- getUrl("JavaScript: window.alert(\'Sorry, Failed to Load XML Data\')", "");
- }
- };
- this.dataXML.load(this.xmlFile);
- };
- TextLoader.prototype.init = function()
- {
- System.useCodePage = true;
- this.targetTextField = "unitTF";
- this.xmlFile = _level0.currentPath + this.filePath;
- this._parent.stop();
- this.loadData();
- };
- Object.registerClass("TextLoader_Symbol2",TextLoader);
-